<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>订单管理系统 - 积分商城</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        body {
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }
        
        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 20px;
        }
        
        header {
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            color: white;
            padding: 15px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            border-radius: 0 0 10px 10px;
            margin-bottom: 25px;
        }
        
        .header-left h1 {
            font-size: 24px;
            font-weight: 600;
        }
        
        .header-right {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        
        .search-box {
            display: flex;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 25px;
            padding: 5px 15px;
            align-items: center;
        }
        
        .search-box input {
            background: transparent;
            border: none;
            color: white;
            padding: 8px;
            width: 220px;
            outline: none;
        }
        
        .search-box input::placeholder {
            color: rgba(255, 255, 255, 0.7);
        }
        
        .user-profile {
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
        }
        
        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #6a11cb;
            font-weight: bold;
        }
        
        .page-title {
            font-size: 22px;
            font-weight: 600;
            margin-bottom: 20px;
            color: #2c3e50;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .page-title i {
            color: #3498db;
        }
        
        .stats-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 20px;
            margin-bottom: 25px;
        }
        
        .stat-card {
            background: white;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
            display: flex;
            align-items: center;
            gap: 15px;
        }
        
        .stat-icon {
            width: 60px;
            height: 60px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            color: white;
        }
        
        .icon-1 {
            background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
        }
        
        .icon-2 {
            background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
        }
        
        .icon-3 {
            background: linear-gradient(135deg, #ffa726 0%, #ff7043 100%);
        }
        
        .icon-4 {
            background: linear-gradient(135deg, #ab47bc 0%, #8e24aa 100%);
        }
        
        .stat-info h3 {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 5px;
        }
        
        .stat-info p {
            color: #777;
            font-size: 14px;
        }
        
        .filters {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: white;
            padding: 15px 20px;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
            margin-bottom: 25px;
        }
        
        .filter-left {
            display: flex;
            gap: 15px;
            align-items: center;
        }
        
        .filter-btn {
            padding: 8px 16px;
            background: #f1f5f9;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            color: #555;
            transition: all 0.3s;
        }
        
        .filter-btn:hover {
            background: #6a11cb;
            color: white;
        }
        
        .filter-right button {
            padding: 10px 20px;
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 500;
            transition: all 0.3s;
        }
        
        .filter-right button:hover {
            opacity: 0.9;
            transform: translateY(-2px);
        }
        
        .orders-table {
            background: white;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
            margin-bottom: 30px;
            overflow-x: auto;
        }
        
        table {
            width: 100%;
            border-collapse: collapse;
        }
        
        th, td {
            padding: 15px;
            text-align: left;
            border-bottom: 1px solid #eee;
        }
        
        th {
            background-color: #f8f9fa;
            font-weight: 600;
            color: #2c3e50;
        }
        
        tr:hover {
            background-color: #f8f9fa;
        }
        
        .status {
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
        }
        
        .status-pending {
            background: rgba(241, 196, 15, 0.15);
            color: #f39c12;
        }
        
        .status-paid {
            background: rgba(46, 204, 113, 0.15);
            color: #27ae60;
        }
        
        .status-refund {
            background: rgba(231, 76, 60, 0.15);
            color: #e74c3c;
        }
        
        .status-shipped {
            background: rgba(52, 152, 219, 0.15);
            color: #3498db;
        }
        
        .status-completed {
            background: rgba(155, 89, 182, 0.15);
            color: #9b59b6;
        }
        
        .action-icons {
            display: flex;
            gap: 10px;
        }
        
        .action-icon {
            cursor: pointer;
            padding: 8px;
            border-radius: 5px;
            transition: all 0.3s;
        }
        
        .action-icon:hover {
            background-color: #f0f4f8;
        }
        
        .view-icon {
            color: #3498db;
        }
        
        .edit-icon {
            color: #f39c12;
        }
        
        .delete-icon {
            color: #e74c3c;
        }
        
        .refund-icon {
            color: #9b59b6;
        }
        
        .pagination {
            display: flex;
            justify-content: center;
            margin-top: 20px;
            gap: 8px;
        }
        
        .page-item {
            padding: 8px 14px;
            border: 1px solid #ddd;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s;
        }
        
        .page-item:hover {
            background: #f0f4f8;
        }
        
        .page-item.active {
            background: #3498db;
            color: white;
            border-color: #3498db;
        }
        
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            display: none;
        }
        
        .modal-content {
            background-color: white;
            border-radius: 12px;
            width: 500px;
            max-width: 90%;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            overflow: hidden;
        }
        
        .modal-header {
            padding: 16px 20px;
            border-bottom: 1px solid #e8e8e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .modal-title {
            font-size: 18px;
            font-weight: 600;
            color: #2c3e50;
        }
        
        .close-btn {
            background: none;
            border: none;
            font-size: 20px;
            cursor: pointer;
            color: #95a5a6;
        }
        
        .modal-body {
            padding: 20px;
            max-height: 60vh;
            overflow-y: auto;
        }
        
        .order-details {
            display: grid;
            gap: 15px;
        }
        
        .detail-item {
            display: flex;
            justify-content: space-between;
            padding: 10px 0;
            border-bottom: 1px solid #eee;
        }
        
        .detail-label {
            font-weight: 500;
            color: #555;
        }
        
        .detail-value {
            color: #333;
        }
        
        .modal-footer {
            padding: 16px 20px;
            border-top: 1px solid #e8e8e8;
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }
        
        .btn {
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s;
        }
        
        .btn-primary {
            background: #3498db;
            color: white;
            border: none;
        }
        
        .btn-primary:hover {
            background: #2980b9;
        }
        
        .btn-secondary {
            background: #f8f9fa;
            color: #495057;
            border: 1px solid #ddd;
        }
        
        .btn-secondary:hover {
            background: #e9ecef;
        }
        
        .btn-danger {
            background: #e74c3c;
            color: white;
            border: none;
        }
        
        .btn-danger:hover {
            background: #c0392b;
        }
        
        @media (max-width: 768px) {
            .header {
                flex-direction: column;
                gap: 15px;
            }
            
            .header-right {
                width: 100%;
                justify-content: center;
            }
            
            .search-box {
                width: 100%;
            }
            
            .search-box input {
                width: 100%;
            }
            
            .stats-cards {
                grid-template-columns: 1fr;
            }
            
            .filters {
                flex-direction: column;
                gap: 15px;
            }
            
            .filter-left {
                flex-wrap: wrap;
            }
            
            .orders-table {
                overflow-x: auto;
            }
            
            table {
                min-width: 600px;
            }
        }
    </style>
</head>
<body>
    <header>
        <div class="header-left">
            <h1><i class="fas fa-shopping-cart"></i> 订单管理系统</h1>
        </div>
        <div class="header-right">
            <div class="search-box">
                <i class="fas fa-search"></i>
                <input type="text" placeholder="搜索订单...">
            </div>
            <div class="user-profile">
                <div class="user-avatar">A</div>
                <span>管理员</span>
            </div>
        </div>
    </header>
    
    <div class="container">
        <div class="page-title">
            <i class="fas fa-list-alt"></i>
            <span>订单管理</span>
        </div>
        
        <div class="stats-cards">
            <div class="stat-card">
                <div class="stat-icon icon-1">
                    <i class="fas fa-file-invoice"></i>
                </div>
                <div class="stat-info">
                    <h3>156</h3>
                    <p>总订单数</p>
                </div>
            </div>
            
            <div class="stat-card">
                <div class="stat-icon icon-2">
                    <i class="fas fa-check-circle"></i>
                </div>
                <div class="stat-info">
                    <h3>128</h3>
                    <p>已完成订单</p>
                </div>
            </div>
            
            <div class="stat-card">
                <div class="stat-icon icon-3">
                    <i class="fas fa-exclamation-circle"></i>
                </div>
                <div class="stat-info">
                    <h3>15</h3>
                    <p>待处理订单</p>
                </div>
            </div>
            
            <div class="stat-card">
                <div class="stat-icon icon-4">
                    <i class="fas fa-undo"></i>
                </div>
                <div class="stat-info">
                    <h3>13</h3>
                    <p>退款申请</p>
                </div>
            </div>
        </div>
        
        <div class="filters">
            <div class="filter-left">
                <button class="filter-btn"><i class="fas fa-filter"></i> 状态筛选</button>
                <button class="filter-btn"><i class="fas fa-calendar"></i> 时间范围</button>
                <button class="filter-btn"><i class="fas fa-sort"></i> 排序方式</button>
            </div>
            <div class="filter-right">
                <button><i class="fas fa-plus"></i> 新增订单</button>
            </div>
        </div>
        
        <div class="orders-table">
            <table>
                <thead>
                    <tr>
                        <th>订单号</th>
                        <th>用户</th>
                        <th>商品</th>
                        <th>金额</th>
                        <th>状态</th>
                        <th>下单时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>#ORD-2023-001</td>
                        <td>张三</td>
                        <td>iPhone 14 Pro</td>
                        <td>¥7,999</td>
                        <td><span class="status status-paid">已支付</span></td>
                        <td>2023-08-15 10:30</td>
                        <td class="action-icons">
                            <span class="action-icon view-icon" title="查看详情"><i class="fas fa-eye"></i></span>
                            <span class="action-icon edit-icon" title="编辑订单"><i class="fas fa-edit"></i></span>
                            <span class="action-icon delete-icon" title="删除订单"><i class="fas fa-trash"></i></span>
                        </td>
                    </tr>
                    <tr>
                        <td>#ORD-2023-002</td>
                        <td>李四</td>
                        <td>华为 Mate 50</td>
                        <td>¥5,499</td>
                        <td><span class="status status-shipped">已发货</span></td>
                        <td>2023-08-16 14:25</td>
                        <td class="action-icons">
                            <span class="action-icon view-icon" title="查看详情"><i class="fas fa-eye"></i></span>
                            <span class="action-icon edit-icon" title="编辑订单"><i class="fas fa-edit"></i></span>
                            <span class="action-icon delete-icon" title="删除订单"><i class="fas fa-trash"></i></span>
                        </td>
                    </tr>
                    <tr>
                        <td>#ORD-2023-003</td>
                        <td>王五</td>
                        <td>小米 13</td>
                        <td>¥3,999</td>
                        <td><span class="status status-refund">退款中</span></td>
                        <td>2023-08-17 16:30</td>
                        <td class="action-icons">
                            <span class="action-icon view-icon" title="查看详情"><i class="fas fa-eye"></i></span>
                            <span class="action-icon refund-icon" title="处理退款"><i class="fas fa-undo"></i></span>
                            <span class="action-icon delete-icon" title="删除订单"><i class="fas fa-trash"></i></span>
                        </td>
                    </tr>
                    <tr>
                        <td>#ORD-2023-004</td>
                        <td>赵六</td>
                        <td>iPad Air</td>
                        <td>¥4,299</td>
                        <td><span class="status status-completed">已完成</span></td>
                        <td>2023-08-18 09:15</td>
                        <td class="action-icons">
                            <span class="action-icon view-icon" title="查看详情"><i class="fas fa-eye"></i></span>
                            <span class="action-icon edit-icon" title="编辑订单"><i class="fas fa-edit"></i></span>
                            <span class="action-icon delete-icon" title="删除订单"><i class="fas fa-trash"></i></span>
                        </td>
                    </tr>
                    <tr>
                        <td>#ORD-2023-005</td>
                        <td>钱七</td>
                        <td>AirPods Pro</td>
                        <td>¥1,899</td>
                        <td><span class="status status-pending">待支付</span></td>
                        <td>2023-08-19 11:45</td>
                        <td class="action-icons">
                            <span class="action-icon view-icon" title="查看详情"><i class="fas fa-eye"></i></span>
                            <span class="action-icon edit-icon" title="编辑订单"><i class="fas fa-edit"></i></span>
                            <span class="action-icon delete-icon" title="删除订单"><i class="fas fa-trash"></i></span>
                        </td>
                    </tr>
                </tbody>
            </table>
            
            <div class="pagination">
                <div class="page-item">上一页</div>
                <div class="page-item active">1</div>
                <div class="page-item">2</div>
                <div class="page-item">3</div>
                <div class="page-item">下一页</div>
            </div>
        </div>
    </div>
    
    <!-- 订单详情模态框 -->
    <div class="modal-overlay" id="detailModal">
        <div class="modal-content">
            <div class="modal-header">
                <h2 class="modal-title">订单详情</h2>
                <button class="close-btn">&times;</button>
            </div>
            <div class="modal-body">
                <div class="order-details">
                    <div class="detail-item">
                        <span class="detail-label">订单号：</span>
                        <span class="detail-value">#ORD-2023-001</span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">用户：</span>
                        <span class="detail-value">张三 (138****1234)</span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">商品：</span>
                        <span class="detail-value">iPhone 14 Pro</span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">金额：</span>
                        <span class="detail-value">¥7,999</span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">状态：</span>
                        <span class="detail-value"><span class="status status-paid">已支付</span></span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">下单时间：</span>
                        <span class="detail-value">2023-08-15 10:30</span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">支付时间：</span>
                        <span class="detail-value">2023-08-15 10:35</span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">收货地址：</span>
                        <span class="detail-value">北京市海淀区中关村大街1号</span>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-secondary">关闭</button>
                <button class="btn btn-primary">打印订单</button>
            </div>
        </div>
    </div>
    
    <!-- 退款处理模态框 -->
    <div class="modal-overlay" id="refundModal">
        <div class="modal-content">
            <div class="modal-header">
                <h2 class="modal-title">处理退款申请</h2>
                <button class="close-btn">&times;</button>
            </div>
            <div class="modal-body">
                <div class="order-details">
                    <div class="detail-item">
                        <span class="detail-label">订单号：</span>
                        <span class="detail-value">#ORD-2023-003</span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">用户：</span>
                        <span class="detail-value">王五 (139****5678)</span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">商品：</span>
                        <span class="detail-value">小米 13</span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">金额：</span>
                        <span class="detail-value">¥3,999</span>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">退款原因：</span>
                        <span class="detail-value">商品存在质量问题，屏幕显示异常</span>
                    </div>
                </div>
                <div style="margin-top: 20px;">
                    <label style="display: block; margin-bottom: 8px; font-weight: 500;">处理意见：</label>
                    <textarea style="width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; min-height: 100px;" placeholder="请输入处理意见..."></textarea>
                </div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-secondary">拒绝退款</button>
                <button class="btn btn-primary">同意退款</button>
            </div>
        </div>
    </div>

    <script>
        // 模态框控制
        const detailModal = document.getElementById('detailModal');
        const refundModal = document.getElementById('refundModal');
        const closeButtons = document.querySelectorAll('.close-btn');
        
        // 查看详情按钮
        document.querySelectorAll('.view-icon').forEach(icon => {
            icon.addEventListener('click', () => {
                detailModal.style.display = 'flex';
            });
        });
        
        // 处理退款按钮
        document.querySelectorAll('.refund-icon').forEach(icon => {
            icon.addEventListener('click', () => {
                refundModal.style.display = 'flex';
            });
        });
        
        // 关闭模态框
        closeButtons.forEach(button => {
            button.addEventListener('click', () => {
                detailModal.style.display = 'none';
                refundModal.style.display = 'none';
            });
        });
        
        // 点击模态框外部关闭
        document.querySelectorAll('.modal-overlay').forEach(overlay => {
            overlay.addEventListener('click', (e) => {
                if (e.target === overlay) {
                    overlay.style.display = 'none';
                }
            });
        });
        
        // 删除订单按钮
        document.querySelectorAll('.delete-icon').forEach(icon => {
            icon.addEventListener('click', function() {
                const orderId = this.closest('tr').querySelector('td:first-child').textContent;
                if (confirm(`确定要删除订单 ${orderId} 吗？此操作不可撤销。`)) {
                    this.closest('tr').style.opacity = '0';
                    setTimeout(() => {
                        this.closest('tr').remove();
                    }, 300);
                }
            });
        });
        
        // 分页功能
        document.querySelectorAll('.page-item').forEach(item => {
            item.addEventListener('click', function() {
                document.querySelectorAll('.page-item').forEach(i => i.classList.remove('active'));
                this.classList.add('active');
            });
        });
    </script>
</body>
</html>
